Draft
Conversation
To separate the client into time zones (planned are are at least two, one for the renderer and one for everything else) precise time counter independent of the complicated and delay prone timer framework are needed. * Move Sys_Milliseconds() from threads.cpp (were it doesn't belong) into the system depended code. * Implement Sys_Microseconds() for Windows and Posix plattform. * Make Sys_Milliseconds() a wrapper around Sys_Microseconds(). * Add header entries for Sys_Microseconds().
* Implement some kind of break, i.e. slow the main loop a little bit down and use special OPCODES to tell the CPU that we are in a very tight spin loop. This prevent overheating. * Introduce the render timezone for the renderer, call the renderer up to 300 times a second. This is currently hartcoded, a cvar will be introduced in a later commit. * Everything else is the game timezone, hartcoded to 60 frames. The game can't run faster anyways. * COmment old timeer based break. The code isn't removed because we need it to optionally support the old behaviour without time zones.
Contributor
Author
|
I just forced pushed the branch:
To make it clear. The goal of this pull request is to split the client into at least two time zones and allow the addition of more time zones at a later time. The goal is not to solve the 60 hz problem. That will be done (if ever) at a later time. |
Contributor
Author
|
I've added two cvars:
Both cvar can be set at runtime without restart. I've played through the Alpha Laps, the game seems to run fine in async mode. |
Member
|
just a quick untested win32 build of this branch rebased on current master: dhewm3_1.5.1_RC2+async_win32.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
@DanielGibson asked me if I could have a look at dhewm3s timing code and estimate if it's possible to make the client asynchronous, i.e. render as many frames as possible without breaking the game logic. This is a very first try. The approach taken is the same as in Yamagi Quake II. The client is split into two time zones, renderframes for the renderer and clientframes for everything else.
General observations:
What's working:
What's not working:
Assertion 'node1->object == NULL && node2->object == NULL' failed.in BTree.h:442. I'm unable to reproduce it. The coredump was broken, so no chance to further investigate it.What's missing:
The big question is if this is the way to go or if it would be better to make the timer subsystem more accurate and split the global
TRIGGER_EVENT_ONEtimer (which is now unused) into two distinct times. One for the client and one for the renderer. In any case it is possible to make dhewm3 asynchronous and it looks easier than I initially thought.